Home > C Programming > Preprocessor Directives > Questions and Answers
Exercise:
01. |
What is the output of following C code? #define a 10 main() { #define a 50 printf("%d",a); } | |||||||||||
|
02. |
What is the output of following C code? #define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); } | |||||||||||
|
03. |
What is the output of following C code? #define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); } | |||||||||||
|
04. |
What is the output of following C code? #define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); } | |||||||||||
|
05. |
What is the output of following C code? #if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); } | |||||||||||
|
06. |
What will be output if you will compile and execute the following c code? 01 #include 02 #define x 5+2 03 int main() 04 { 05 int i; 06 i=x*x*x; 07 printf("%d",i); 08 return 0; 09 } | |||||||||||||||
|
07. | In which header file is the NULL macro defined? | |||||||||||
|
08. |
What will be the result of the following code? #define TRUE 0 while(TRUE) { printf(“Wipro-BITSâ€); } printf(“BITS PILANIâ€); | |||||||||||
|
09. |
Referring to the sample below, what is MAX_NUM? #define MAX_NUM 15 | |||||||||||||||
|